home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / BoopsiColorWheelTags.st < prev    next >
Text File  |  2002-05-05  |  2KB  |  55 lines

  1. " -------------------------------------------------------------------- "
  2. " BoopsiColorWheelTags Class is a Singleton class that allows the user "
  3. " to reference BOOPSI ColorWheel class tags' hexadecimal values.       "
  4. ""
  5. "  EXAMPLE:  'myTag <- colorWheelTags getTag: #WHEEL_Hue'              "
  6. ""
  7. " ALL singleton classes MUST contain the following:                    "
  8. ""
  9. "   the methods:  isSingleton AND privateSetup     AND                 "
  10. "                 uniqueInstance Class instance variable.              "
  11. " -------------------------------------------------------------------- "
  12.  
  13. Class BoopsiColorWheelTags :Dictionary ! uniqueInstance !
  14. [
  15.    isSingleton
  16.      ^ true  
  17. |  
  18.    privateNew ! newinstance !
  19.      newinstance <- super new.
  20.  
  21.      ^ newinstance
  22. |
  23.    new
  24.      ^ self privateSetup
  25. |
  26.    getTag: tagKey
  27.      ^ self at: tagKey
  28. |
  29.    privateInitializeDictionary
  30.  
  31.      self at: #WHEEL_Hue            put: 16r84000001. " set/get Hue            "
  32.      self at: #WHEEL_Saturation     put: 16r84000002. " set/get Saturation     "
  33.      self at: #WHEEL_Brightness     put: 16r84000003. " set/get Brightness     "
  34.      self at: #WHEEL_HSB            put: 16r84000004. " set/get ColorWheelHSB  "
  35.      self at: #WHEEL_Red            put: 16r84000005. " set/get Red            "
  36.      self at: #WHEEL_Green          put: 16r84000006. " set/get Green          "
  37.      self at: #WHEEL_Blue           put: 16r84000007. " set/get Blue           "
  38.      self at: #WHEEL_RGB            put: 16r84000008. " set/get ColorWheelRGB  "
  39.      self at: #WHEEL_Screen         put: 16r84000009. " init screen/enviroment "
  40.      self at: #WHEEL_Abbrv          put: 16r8400000A. " 'GCBMRY' if English    "
  41.      self at: #WHEEL_Donation       put: 16r8400000B. " colors donated by app  "
  42.      self at: #WHEEL_BevelBox       put: 16r8400000C. " inside a bevel box     "
  43.      self at: #WHEEL_GradientSlider put: 16r8400000D. " attached gradient slider  "
  44.      self at: #WHEEL_MaxPens        put: 16r8400000E. " max # of pens to allocate "
  45. |
  46.    privateSetup
  47.      (uniqueInstance isNil)
  48.        ifTrue: [uniqueInstance <- self privateNew.
  49.                 
  50.                 self privateInitializeDictionary.
  51.                ].
  52.                
  53.      ^ self    "or ^ uniqueInstance??"
  54. ]
  55.